package com.kusen.springsource;

import com.kusen.springsource.aop.HelloService;
import com.kusen.springsource.config.MyConfig;
import com.kusen.springsource.empity.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.concurrent.locks.ReentrantLock;

/**
 * 注解吧的spring用法
 */
public class AnnotationMainTest {
	public static void main(String[] args) {
		ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);
		Person helloService = applicationContext.getBean(Person.class);
		System.out.println(helloService);
//
//		HelloService helloService = applicationContext.getBean(HelloService.class);
//		helloService.sayHello("hopeful");
//		ReentrantLock lock=new ReentrantLock();
//		lock.lock();
	}
}
